Conversation
…at_hash_sorted, dbh defaults
TraceLevel / trace:
* STORE accepts "SQL|foo|3" strings (routed through
parse_trace_flags) and treats undef as a no-op, matching real
DBI's "local $h->{TraceLevel} = undef" idiom.
* $dbh->trace($level, $file) now routes the 3-arg form to
DBI::trace so handle-level calls install the process-global
trace filehandle the same way the class method does.
* parse_trace_flags carps on unknown flags (when Warn is true).
* Statement handles inherit TraceLevel from the parent dbh in
_new_sth.
DBI->internal:
* Now built through _new_drh so it's a proper tied outer handle
with FETCH / STORE hitting DBD::_::common. DBD::Switch::dr
inherits from DBI::dr so isa('DBI::dr') is true. Attribution
and Active defaults are populated so $switch->{Attribution}
returns "DBI $VERSION by Tim Bunce".
dbh default attributes:
* _new_dbh now installs Warn, PrintError / PrintWarn (the
latter off by default unless `-w`), RaiseError, RaiseWarn,
AutoCommit, CompatMode, ShowErrorStatement, ChopBlanks,
LongTruncOk, Executed, ErrCount, FetchHashKeyName, and
LongReadLen with their real-DBI defaults.
* DBI.pm's connect wrapper no longer skips re-applying
user-supplied attrs when a key is already present on the
dbh; the user's connect attr hash is authoritative.
_concat_hash_sorted:
* Rewritten to match real DBI's XS behaviour: undef input ->
undef, non-HASH -> croak, keys unquoted, auto-guess
numeric-vs-lexical sort when sort_type is undef, $a <=> $b
or $a cmp $b for numeric sort.
Unknown-attribute warnings:
* DBD::_::common FETCH / STORE now carp on uppercase-prefixed
attributes that aren't in a known allow-list (mirroring
DBI::PurePerl's %is_valid_attribute). Lowercase keys,
private_*, dbd_*, dbi_* prefixes are always accepted.
Per-test deltas (direct ./jperl):
* t/01basics.t: 95/130 -> 100/100 (halts on unrelated DBI::hash)
* t/05concathash.t: 11/41 -> 41/41
* t/06attrs.t: 136/166 -> 142/166
* t/09trace.t: 83/99 -> 99/99
* t/17handle_error.t: 84/84 maintained
Generated with [Devin](https://cli.devin.ai/docs)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
b1767a8 to
21e12e2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 7 of DBI test-parity work — tightens the semantics of the
pure-Perl DBI shim around tracing, default attributes, and
internal helpers. No Java changes.
Highlights
(
"SQL|foo|3") and treatsundefas a no-op. Statementhandles now inherit
TraceLevelfrom the parent dbh.$dbh->trace($level, $file)routes the 3-arg form toDBI::traceso handle-level calls install the process-globaltrace filehandle.
parse_trace_flagscarps on unknown flags.DBI->internal: now a proper tied outer handle.isa('DBI::dr')is true,Attribution/Activereturn theexpected values.
Warn,PrintError,PrintWarn,RaiseError,AutoCommit,FetchHashKeyName,LongReadLen,etc. are now populated at
_new_dbhtime with their real-DBIdefaults.
_concat_hash_sorted: rewritten to match real DBI's XSsemantics (
undefpassthrough, non-HASH croak, unquoted keys,numeric-vs-lexical sort guessing).
DBD::_::commonFETCH / STOREnow carp on uppercase-prefixed attributes that aren't in a
known allow-list, mirroring
DBI::PurePerl's%is_valid_attribute.Per-test deltas (direct
./jperl t/X.t)t/01basics.tDBI::hash)t/05concathash.tt/06attrs.tt/09trace.tt/17handle_error.tTest plan
makepasses (all unit tests)./jperl ~/.cpan/build/DBI-1.647-5/t/09trace.t→ 99/99./jperl ~/.cpan/build/DBI-1.647-5/t/17handle_error.t→ 84/84 (no regression)./jperl ~/.cpan/build/DBI-1.647-5/t/01basics.t→ 100/100 passing before unrelated halt
Generated with Devin